package com.juli.school.dao.entity;

import java.util.List;
import org.apache.commons.lang3.StringUtils;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.juli.school.dao.base.BaseEntity;
import com.juli.school.dao.bo.PicBo;

/**
 * @Description: 发布信息实体
 * @author gaoxiang
 * @date 2017年11月17日 上午10:59:05
 */
public class Pub extends BaseEntity {
	
	/**
	 * @Fields stuId : 学生ID
	 */
	protected String stuId;
	
	/**
	 * @Fields snStamp : 发布编号
	 */
	protected String snStamp;
	
	/**
	 * @Fields collId : 学校ID
	 */
	protected String collId;
	
	/**
	 * @Fields college : 学校名称
	 */
	protected String college;
	
	/**
	 * @Fields title : 标题
	 */
	protected String title;
	
	/**
	 * @Fields word : 内容
	 */
	protected String word;
	
	/**
	 * @Fields pics : 图片组地址
	 */
	protected String pics;
	
	/**
	 * @Fields gpsAddr : gps定位地址
	 */
	protected String gpsAddr;
	
	/**
	 * @Fields area : 国（guo），省(sheng)，市(shi)，学校(school) 的区分
	 */
	private Integer area;
	
	/**
	 * @Fields areaIds : 发布区域ID
	 */
	protected String areaIds;
	
	/**
	 * @Fields inputTime : 发布时间
	 */
	protected String inputTime;
	
	/**
	 * @Fields endTime : 结束时间
	 */
	protected String endTime;
	
	/**
	 * @Fields isActive : 是否可用
	 */
	protected String isActive = "Y";
	
	/**
	 * @Fields type : 模块名
	 */
	protected String module;
	
	/**
	 * @Fields type : 模块类型
	 */
	protected String type;
	
	/**
	 * @Fields headUrl : 头像图片地址
	 */
	private String headUrl;
	
	/**
	 * @Fields nick : 昵称
	 */
	private String nick;
	
	/**
	 * @Fields honor : 荣誉图标
	 */
	private List<String> honor;
	
	/**
	 * @Fields leftDays : 剩余天数
	 */
	private String leftDays;
	
	/**
	 * @Fields picArray : 图片组
	 */
	List<PicBo> picArray;
	
	/**
	 * @Fields likeCount : 点赞数
	 */
	private String likeCount;
	
	/**
	 * @Fields isLike : 是否点赞
	 */
	private boolean isLike;
	
	/**
	 * @Fields isFavorite : 是否收藏
	 */
	private boolean isFavorite;
	
	/**
	 * @Fields provinceID : 省id
	 */
	private String provinceId;
	
	/**
	 * @Fields cityID : 市id
	 */
	private String cityId;
	
	/**
	 * @Fields price : 价格
	 */
	private String price;
	
	/**
	 * @Fields pageNo : 页码
	 */
	private int pageNo = 1;
	
	/**
	 * @Fields pageSize : 每页几条
	 */
	private int pageSize = 10;
	
	/**
	 * @Fields totalMaxId : 一次查看最大ID
	 */
	private String totalMaxId;
	
	/**
	 * @Fields pageMaxId : 增量最大ID
	 */
	private String pageMaxId;
	
	/**
	 * @Fields newCount : 新增的记录数
	 */
	private Integer newCount;
	
	/**
	 * @Fields queryAll : 如果查询历史记录
	 */
	private Boolean queryAll = false;
	
	public String getStuId() {
		return stuId;
	}
	
	public void setStuId(String stuId) {
		this.stuId = stuId;
	}
	
	public String getCollId() {
		return collId;
	}
	
	public void setCollId(String collId) {
		this.collId = collId;
	}
	
	public String getCollege() {
		return college;
	}
	
	public void setCollege(String college) {
		this.college = college;
	}
	
	public String getSnStamp() {
		return snStamp;
	}
	
	public void setSnStamp(String snStamp) {
		this.snStamp = snStamp;
	}
	
	public String getTitle() {
		return title;
	}
	
	public void setTitle(String title) {
		this.title = title;
	}
	
	public String getWord() {
		return word;
	}
	
	public void setWord(String word) {
		this.word = word;
	}
	
	public String getPics() {
		return pics;
	}
	
	public void setPics(String pics) {
		this.pics = pics;
	}
	
	public String getGpsAddr() {
		return gpsAddr;
	}
	
	public void setGpsAddr(String gpsAddr) {
		this.gpsAddr = gpsAddr;
	}
	
	public String getAreaIds() {
		return areaIds;
	}
	
	public void setAreaIds(String areaIds) {
		this.areaIds = areaIds;
	}
	
	public String getInputTime() {
		if (!Strings.isNullOrEmpty(inputTime) && StringUtils.contains(inputTime, "."))
			return StringUtils.substring(inputTime, 0, inputTime.indexOf('.'));
		return inputTime;
	}
	
	public void setInputTime(String inputTime) {
		this.inputTime = inputTime;
	}
	
	public String getEndTime() {
		if (!Strings.isNullOrEmpty(endTime) && StringUtils.contains(endTime, '.')) {
			return StringUtils.substring(endTime, 0, endTime.indexOf('.'));
		}
		return endTime;
	}
	
	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}
	
	public String getIsActive() {
		return isActive;
	}
	
	public void setIsActive(String isActive) {
		this.isActive = isActive;
	}
	
	public String getHeadUrl() {
		return headUrl;
	}
	
	public void setHeadUrl(String headUrl) {
		this.headUrl = headUrl;
	}
	
	public String getNick() {
		return nick;
	}
	
	public void setNick(String nick) {
		this.nick = nick;
	}
	
	public List<String> getHonor() {
		return honor;
	}
	
	public void setHonor(List<String> honor) {
		this.honor = honor;
	}
	
	public String getLeftDays() {
		return leftDays;
	}
	
	public void setLeftDays(String leftDays) {
		this.leftDays = leftDays;
	}
	
	public List<PicBo> getPicArray() {
		String[] arr = StringUtils.split(pics, ";");
		if (arr == null) {
			return null;
		}
		List<PicBo> list = Lists.newArrayList();
		for (String pic : arr) {
			if (Strings.isNullOrEmpty(pic))
				continue;
			String[] pics = StringUtils.split(pic, ",");
			PicBo picBo = new PicBo();
			if (pics != null && pics.length > 0) {
				picBo.setType(pics[0]);
				if (pics.length > 1) {
					picBo.setPicPath(pics[1]);
				}
				if (pics.length > 2) {
					picBo.setSrcPath(pics[2]);
				}
				if (pics.length > 3) {
					picBo.setWidth(pics[3]);
				}
				if (pics.length > 4) {
					picBo.setHeight(pics[4]);
				}
			}
			list.add(picBo);
		}
		return list;
	}
	
	public void setPicArray(List<PicBo> picArray) {
		this.picArray = picArray;
	}
	
	public String getLikeCount() {
		return likeCount;
	}
	
	public void setLikeCount(String likeCount) {
		this.likeCount = likeCount;
	}
	
	public boolean isLike() {
		return isLike;
	}
	
	public void setLike(boolean isLike) {
		this.isLike = isLike;
	}
	
	public boolean isFavorite() {
		return isFavorite;
	}
	
	public void setFavorite(boolean isFavorite) {
		this.isFavorite = isFavorite;
	}
	
	public int getPageNo() {
		return pageNo;
	}
	
	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}
	
	public int getPageSize() {
		return pageSize;
	}
	
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	
	public String getModule() {
		return module;
	}
	
	public void setModule(String module) {
		this.module = module;
	}
	
	public String getType() {
		return type;
	}
	
	public void setType(String type) {
		this.type = type;
	}
	
	public Integer getArea() {
		return area;
	}
	
	public void setArea(Integer area) {
		this.area = area;
	}
	
	public String getProvinceId() {
		return provinceId;
	}
	
	public void setProvinceId(String provinceId) {
		this.provinceId = provinceId;
	}
	
	public String getCityId() {
		return cityId;
	}
	
	public void setCityId(String cityId) {
		this.cityId = cityId;
	}
	
	public String getTotalMaxId() {
		return totalMaxId;
	}
	
	public void setTotalMaxId(String totalMaxId) {
		this.totalMaxId = totalMaxId;
	}
	
	public String getPageMaxId() {
		return pageMaxId;
	}
	
	public void setPageMaxId(String pageMaxId) {
		this.pageMaxId = pageMaxId;
	}
	
	public Integer getNewCount() {
		return newCount;
	}
	
	public void setNewCount(Integer newCount) {
		this.newCount = newCount;
	}
	
	public String getPrice() {
		return price;
	}
	
	public void setPrice(String price) {
		this.price = price;
	}
	
	public Boolean getQueryAll() {
		return queryAll;
	}
	
	public void setQueryAll(Boolean queryAll) {
		this.queryAll = queryAll;
	}
}
